#!/bin/sh

# Mass open all lab files. Do this by opening every lab in a web browser,
# which will invoke each lab's built-in tests.
# Each file should have a yellow input field (so the JavaScript ran)
# and *not* show a test failure (so all embedded tests passed).

# Create a list of labs
grep -l 'src=.*checker.js' [a-z]*.html > ,1

OPENER=xdg-open
if ! which "$OPENER" >/dev/null; then
  OPENER=open
fi

for file in $(cat ,1); do
  ${OPENER} "$file"
done

echo 'Check each lab file to ensure there are no error alerts and that'
echo 'there is a yellow field for input.'
